//
//  UIView+Extension.m
//  ErmaoDJ
//
//  Created by NextStep on 2017/12/26.
//  Copyright © 2017年 NextStep. All rights reserved.
//

#import "UIView+Extension.h"

@implementation UIView (Extension)

-(void)setX:(CGFloat)X {
    CGRect rect = self.frame;
    rect.origin.x = X;
    self.frame = rect;
}
-(CGFloat)X {
    return self.frame.origin.x;
}
-(void)setY:(CGFloat)Y {
    CGRect rect = self.frame;
    rect.origin.y = Y;
    self.frame = rect;
}
-(CGFloat)Y {
    return self.frame.origin.y;
}
-(void)setWidth:(CGFloat)width {
    CGRect rect = self.frame;
    rect.size.width = width;
    self.frame = rect;
}
-(CGFloat)width {
    return self.frame.size.width;
}
-(void)setHeight:(CGFloat)height {
    CGRect rect = self.frame;
    rect.size.height = height;
    self.frame = rect;
}
-(CGFloat)height {
    return self.frame.size.height;
}
-(void)setSize:(CGSize)size {
    CGRect rect = self.frame;
    rect.size = size;
    self.frame = rect;
}
-(CGSize)size {
    return self.frame.size;
}
-(void)setCenterX:(CGFloat)centerX {
    CGPoint center = self.center;
    center.x = centerX;
    self.center = center;
}
-(CGFloat)centerX {
    return self.center.x;
}
-(void)setCenterY:(CGFloat)centerY {
    CGPoint center = self.center;
    center.y = centerY;
    self.center = center;
}
-(CGFloat)centerY {
    return self.center.y;
}

-(void)setOrigin:(CGPoint)origin{
    self.X          = origin.x;
    self.Y          = origin.y;
}

@end
